package com.micro.ai.models.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 模型定义实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("model_definitions")
@Schema(description = "模型定义信息")
public class ModelDefinition implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "模型ID", example = "model_123456789")
    private String id;

    /**
     * 租户ID
     */
    @Schema(description = "租户ID", example = "tenant_001")
    private String tenantId;

    /**
     * 模型名称
     */
    @Schema(description = "模型名称", example = "gpt-4")
    private String modelName;

    /**
     * 模型别名
     */
    @Schema(description = "模型别名", example = "GPT-4")
    private String modelAlias;

    /**
     * 供应商ID
     */
    @Schema(description = "供应商ID", example = "vendor_123")
    private String vendorId;

    /**
     * 类型ID
     */
    @Schema(description = "类型ID", example = "type_123")
    private String typeId;

    /**
     * 上下文长度
     */
    @Schema(description = "上下文长度（最大token数）", example = "8192")
    private Integer contextLength;

    /**
     * 最大输出token数
     */
    @Schema(description = "最大输出token数", example = "2048")
    private Integer maxOutputTokens;

    /**
     * 是否支持函数调用
     */
    @Schema(description = "是否支持函数调用", example = "true")
    private Boolean supportFunctions;

    /**
     * 是否支持视觉
     */
    @Schema(description = "是否支持视觉（图片理解）", example = "true")
    private Boolean supportVision;

    /**
     * 是否支持微调
     */
    @Schema(description = "是否支持微调", example = "true")
    private Boolean supportFineTuning;

    /**
     * 支持的微调方法（JSON）
     */
    @Schema(description = "支持的微调方法（JSON格式）", example = "[\"lora\",\"full_fine_tuning\"]")
    private String fineTuningMethods;

    /**
     * 描述
     */
    @Schema(description = "描述", example = "GPT-4是最新一代的大语言模型，具有强大的推理能力")
    private String description;

    /**
     * 模型元数据（JSON）
     */
    @Schema(description = "模型元数据（JSON格式）", example = "{\"parameters\":\"175B\",\"architecture\":\"transformer\"}")
    private String modelMetadata;

    /**
     * 状态：active-活跃, deprecated-已弃用, beta-测试版
     */
    @Schema(description = "状态（active-活跃，deprecated-已弃用，beta-测试版）", example = "active", allowableValues = {"active", "deprecated", "beta"})
    private String status;

    /**
     * 发布日期
     */
    @Schema(description = "发布日期", example = "2023-03-14")
    private LocalDate releaseDate;

    /**
     * 创建人ID
     */
    @Schema(description = "创建人ID", example = "1001")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间", example = "2025-01-01 00:00:00")
    private LocalDateTime updatedAt;
}
